

package top.continew.admin.question.manger.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.stereotype.Service;
import top.continew.admin.question.model.TestType;
import top.continew.admin.question.manger.service.TestTypeService;
import top.continew.admin.question.manger.service.model.TestTypeVO;

import java.util.List;
import java.util.stream.Collectors;

@Service

public class TestTypeServiceImpl implements TestTypeService {
    @Override
    public List<TestTypeVO> getList() {
        return new TestType().selectList(new QueryWrapper<TestType>().eq("status", "1")).stream().map(s -> {
            TestTypeVO testTypeVO = new TestTypeVO();
            testTypeVO.setId(s.getId());
            testTypeVO.setName(s.getName());
            return testTypeVO;
        }).collect(Collectors.toList());
    }
}
